package com.sikaryofficial.backend.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author : qinjinyuan
 * @desc : 举报类型枚举
 * @date : 2023/11/04 10:08
 */
@Getter
@AllArgsConstructor
public enum ReportTypeEnum {

    /** 举报类型：1-淫秽色情,2-营销广告,3-网络暴力,4-违法信息,
     5-虚假谣言,6-诈骗内容,7-恐怖主义内容,8-侵犯版权内容,
     9-仇恨言论,10-骚扰、欺凌和威胁,
     11-违法内容,12-涉及儿童安全,13-其他不良内容 */
    /**
     * 1. Obscene and Pornography, 2. Marketing Advertising, 3. Cyber Violence, 4. Illegal Information,
     * <p>
     * 5- False rumors, 6- Fraudulent content, 7- Terrorist content, 8- Copyright infringement content,
     * <p>
     * 9- Hateful speech, 10- Harassment, bullying, and threats,
     * <p>
     * 11- illegal content, 12- involving child safety, 13- other harmful content
     */
    OBSCENE_PORNOGRAPHY(1, "Obscene Pornography"),
    MARKETING_ADVERTISING(2, "Marketing Advertising"),
    CYBER_VIOLENCE(3, "Cyber Violence"),
    ILLEGAL_INFORMATION(4, "Illegal Information"),
    FALSE_RUMORS(5, "False rumors"),
    FRAUDULENT_CONTENT(6, "Fraudulent content"),
    TERRORIST_CONTENT(7, "Terrorist content"),
    COPYRIGHT_INFRINGEMENT_CONTENT(8, "Copyright infringement content"),
    HATEFUL_SPEECH(9, "Hateful speech"),
    HARASSMENT_BULLYING_THREATS(10, "Harassment bullying threats"),
    ILLEGAL_CONTENT(11, "illegal content"),
    INVOLVING_CHILD_SAFETY(12, "involving child safety"),
    OTHER_HARMFUL_CONTENT(13, "other harmful content"),
    COUNTERFEIT_REPORTING(14, "counterfeit reporting"),
    ;

    private final Integer reportType;
    private final String description;

    public static ReportTypeEnum getEnum(Integer code) {
        return Arrays.stream(ReportTypeEnum.values())
                .filter(pointRuleEnum -> Objects.nonNull(code) &&  pointRuleEnum.getReportType().equals(code))
                .findFirst().orElse(null);
    }
}
